package com.ty.day4;

import java.util.Timer;
import java.util.TimerTask;

/**
 * Created by IntelliJ IDEA.
 *
 * @author : txy
 * @create : 2023/11/17 15:45
 */
public class Anonymity {
    public static void main(String[] args) {
        Timer timer = new Timer();
        String name ="王吉吉";
        ChongJiBo chongJiBo = new ChongJiBo();

        timer.schedule(new TimerTask() {
            private int count=1;

            @Override
            public void run() {
                System.out.println("第"+count+"次提醒，"+name+"，该奖励自己了");
                count += 1;
            }
        },1000,1000);
    }
    static class ChongJiBo{
        String name;
        public ChongJiBo(){
            this.name="冲击波";
        }
    }
}
